#ifndef STMSHOW_H
#define STMSHOW_H

#include <QWidget>
#include <QTimer>
#include "qcustomplot.h"
#include "QDebug"
#include "globalval.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonParseError>
#include <QJsonValue>
#include <mqtthandler.h>
#include "myhomepage.h"
#define QPushButton_Light_STYTLE_OPEN (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/lighton.png);\
    /*字体大小为10点*/\
    font-size:10pt;\
    /*字体颜色为白色*/\
    color:white;\
    font-family:MiSans;\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/lighton.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/lighton.png);\
    /*背景颜色*/\
background-color:rgb(164, 223, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
#define QPushButton_Light_STYTLE_CLOSE (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/lightoff.png);\
background-color:rgb(44, 115, 153);\
    /*字体大小为10点*/\
    font-size:10pt;\
  font-family:MiSans;\
    /*字体颜色为白色*/\
    color:white;\
    /*背景颜色*/\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/lightoff.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/lightoff.png);\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
#define QPushButton_Fan_STYTLE_OPEN (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/jichuagnkaiguan.png);\
    /*字体大小为10点*/\
    font-size:10pt;\
    /*字体颜色为白色*/\
    color:white;\
    font-family:MiSans;\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/jichuagnkaiguan.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/jichuagnkaiguan.png);\
    /*背景颜色*/\
background-color:rgb(164, 223, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
#define QPushButton_Fan_STYTLE_CLOSE (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/mecoff.png);\
background-color:rgb(44, 115, 153);\
    /*字体大小为10点*/\
    font-size:10pt;\
  font-family:MiSans;\
    /*字体颜色为白色*/\
    color:white;\
    /*背景颜色*/\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/mecoff.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/mecoff.png);\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
#define QPushButton_jingbao_STYTLE_OPEN (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/ringon.png);\
    /*字体大小为10点*/\
    font-size:10pt;\
    /*字体颜色为白色*/\
    color:white;\
    font-family:MiSans;\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/ringon.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/ringon.png);\
    /*背景颜色*/\
background-color:rgb(164, 223, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
#define QPushButton_jingbao_STYTLE_CLOSE (QString("\
/*按钮普通态*/\
QPushButton\
{\
border-image:url(:/new/prefix1/ringoff.png);\
background-color:rgb(44, 115, 153);\
    /*字体大小为10点*/\
    font-size:10pt;\
  font-family:MiSans;\
    /*字体颜色为白色*/\
    color:white;\
    /*背景颜色*/\
    /*边框圆角半径为8像素*/\
    border-radius:8px;\
    border-top-left-radius:20px;\
    border-top-right-radius:20px;\
    border-bottom-left-radius:20px;\
    border-bottom-right-radius:20px;\
}\
/*按钮悬停态*/\
QPushButton:hover\
{\
border-image:url(:/new/prefix1/ringoff.png);\
    /*背景颜色*/\
    background-color:rgb(63, 131, 219);\
}\
/*按钮按下态*/\
QPushButton:pressed\
{\
border-image:url(:/new/prefix1/ringoff.png);\
    /*背景颜色*/\
    background-color:rgb(210, 239, 255);\
    /*左内边距为3像素，让按下时字向右移动3像素*/\
    padding-left:3px;\
    /*上内边距为3像素，让按下时字向下移动3像素*/\
    padding-top:3px;\
}"))
namespace Ui {
class STMShow;
}

class STMShow : public QWidget
{
    Q_OBJECT

public:
    explicit STMShow(QWidget *parent = 0);
    ~STMShow();
    //设置qcustomplot画图属性，实时
    void setupRealtimeDataDemo(QCustomPlot *customPlot);
private slots:
    void realtimeDataSlot(double);
    void pushButtonLight();
    void dataUpSlot(const QByteArray &);
    void pushButtonFan();
    void flashSlot();
private:
    Ui::STMShow *ui;
    QTimer dataTimer;
signals:
    realtimeDatasignal(double);

};

#endif // STMSHOW_H
